<?php
require_once('internal/Admin.base.php');

class ZenAdmin extends Admin {
	private $settings;
	function __construct() {
		$this->loadSettings();
		parent::__construct();

		if (empty($this->title)) $this->title = empty($lang[$this->moduleName]['name']) ? $this->info['fullname'] : $lang[$this->moduleName]['name'];
		$this->head->setTitle($this->title.' - mae.');
		$this->head->add('meta', array('name'=>'Robots', 'content'=>'noindex, nofollow'));
		$this->head->addCSS("admins/zenadmin/themes/{$this->settings[theme]}/theme.css");
		$this->head->addScript('1 internal/mootools.js');
		if ($this->settings['ie']) 
			$this->head->addCSS('IE[admins/zenadmin/themes/'.$this->settings['theme'].'/ie.css]');
	}
	protected function siteTop() {
		global $lang;
		?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php
$this->head->write();
?>
</head>
<body id="zenadmin">
    <div id="container">
		<div id="header">
			<div id="header2">
				<h1><span>mae. administration</span></h1>
				<?php $this->displayMenu(); ?>
			</div>
		</div>
		<div id="content">
			<h2><span><?php echo $this->title; ?></span></h2>
			<div id="pdata">
				<div id="data">
					<?php $this->displaySections(); ?>
					<div id="realcontent">
	<?php
	}

	protected function siteBottom() {
	global $lang;
	?>
					</div>
				</div>
			</div>
		</div>
		<div id="footer">
			<div id="footer2">
				<?php
				$this->displayFooter();
				?>
			</div>
		</div>
	</div>
</body>
</html>
	<?php
	}

	/*
	 function loadSettings()
	 Loads settings from the XML file
	*/
	protected function loadSettings() {
		$xml = simplexml_load_file('admins/zenadmin/settings.xml');
		$theme = (string)$xml->theme;
		$xml2 = simplexml_load_file('admins/zenadmin/themes/'.$theme.'/config.xml');
		$this->settings = array(
			'theme' => $theme,
			'ie' => ((string)$xml2->ie=='true') ? true : false
		);
	}
}
?>
